begin
   dbms_scheduler.create_program (
       program_name => 'KOPIUJ_LOTY_JOB_SCHEDULE'
      ,program_type => 'STORED_PROCEDURE'
      ,program_action => 'kopiujloty'      
      ,enabled => TRUE
      ,comments => 'Kopiuj loty job schedule.');

  dbms_scheduler.create_schedule(  
      schedule_name => 'KOPIUJ_LOTY_SCHEDULE'
    , start_date =>  SYSTIMESTAMP
    , repeat_interval => 'FREQ=WEEKLY'
    , comments => 'Kopiuj loty schedule');
        
    dbms_scheduler.create_job(
       job_name => 'KOPIUJ_LOTY_JOB'
     , program_name =>'KOPIUJ_LOTY_JOB_SCHEDULE'
     , schedule_name =>'KOPIUJ_LOTY_SCHEDULE'
     , enabled => TRUE
     , comments => 'Kopiuj loty job');
END;
/